#camera sensor config
PRODUCT_COPY_FILES += \
     $(call md-overlayrsb,module/camera/sensor_config.xml):$(TARGET_COPY_OUT_VENDOR)/etc/sensor_config.xml

#===============start camera configuration===============
#------section 1: software structure------
TARGET_BOARD_SPRD_EXFRAMEWORKS_SUPPORT := true
#HAL1.0  HAL2.0  HAL3.0
TARGET_BOARD_CAMERA_HAL_VERSION := HAL3.0
#support 64bit isp
TARGET_BOARD_CAMERA_ISP_64BIT := false
# temp for isp3.0
TARGET_BOARD_CAMERA_ISP_VERSION := 2.4
#isp AE ver 0 or 1
TARGET_BOARD_CAMERA_ISP_AE_VERSION := 1
TARGET_BOARD_IS_SC_FPGA := false
#------section 2: sensor & flash config------
#camera auto detect sensor
TARGET_BOARD_CAMERA_AUTO_DETECT_SENSOR := true
#select camera 2M,3M,5M,8M,13M,16M,21M
CAMERA_SUPPORT_SIZE := 8M
FRONT_CAMERA_SUPPORT_SIZE := 2M
TARGET_BOARD_NO_FRONT_SENSOR := false
TARGET_BOARD_SENSOR2_SUPPORT := false
TARGET_BOARD_SENSOR3_SUPPORT := false
TARGET_BOARD_SBS_MODE_SENSOR := false
TARGET_BOARD_SBS_SENSOR_FRONT := false
#camera sensor support list
CAMERA_SENSOR_TYPE_BACK := "gc5025_pike2"
CAMERA_SENSOR_TYPE_FRONT := "gc2385_pike2"
CAMERA_SENSOR_TYPE_BACK_EXT :=
CAMERA_SENSOR_TYPE_FRONT_EXT :=
#tuning param support list
TUNING_PARAM_LIST := "gc02m2_pike2,gc030a_pike2,gc2385_pike2,ov2680_pike2,ov8858_pike2,gc5025_pike2,gc5035_pike2,gc2365_pike2,gc2235_pike2"
#camera specific sensor independent define
TARGET_BOARD_OV8856_SHINE_MIPI_LANE := 4
#sensor interface
TARGET_BOARD_BACK_CAMERA_INTERFACE := mipi
TARGET_BOARD_FRONT_CAMERA_INTERFACE := mipi
#select mipi d-phy mode(none, phya, phyb, phyab)
TARGET_BOARD_FRONT_CAMERA_MIPI := phyb
TARGET_BOARD_BACK_CAMERA_MIPI := phyab
#select ccir pclk src(source0, source1)
TARGET_BOARD_FRONT_CAMERA_CCIR_PCLK := source0
TARGET_BOARD_BACK_CAMERA_CCIR_PCLK := source0
#flash led  feature
TARGET_BOARD_CAMERA_FLASH_LED_0 := true # flash led0 config
TARGET_BOARD_CAMERA_FLASH_LED_1 := true # flash led1 config
#front flash type
#lcd,led,flash
TARGET_BOARD_FRONT_CAMERA_FLASH_TYPE := false
#------section 3: feature config------
#select camera zsl cap mode
TARGET_BOARD_CAMERA_CAPTURE_MODE := false
#support 4k record
TARGET_BOARD_CAMERA_SUPPORT_4K_RECORD := false
ifneq ($(strip $(CMCC_PROJECT)),true)
#face detect
TARGET_BOARD_CAMERA_FACE_DETECT := true
#UCAM feature
TARGET_BOARD_CAMERA_FACE_BEAUTY := true
#hdr capture
TARGET_BOARD_CAMERA_HDR_CAPTURE := true
#TARGET_BOARD_CAMERA_HDR_SPRD_LIB := true
TARGET_BOARD_CAMERA_SUPPORT_AUTO_HDR := true
#sprd cnr feature
TARGET_BOARD_CAMERA_CNR_CAPTURE := true
#hdr vsersion
TARGET_BOARD_SPRD_HDR_VERSION := 2
#blur mode enble
TARGET_BOARD_BLUR_MODE_SUPPORT := true
#portrait_single
TARGET_BOARD_PORTRAIT_SINGLE_SUPPORT := true
#covered camera enble
TARGET_BOARD_COVERED_SENSOR_SUPPORT := false
# BOKEH mode enable
TARGET_BOARD_BOKEH_MODE_SUPPORT := nosbs
# Need SurperResolution Process
TARGET_BOARD_NEED_SR_ENABLE := false
#3dnr capture
TARGET_BOARD_CAMERA_3DNR_CAPTURE := true
endif
#uv denoise
TARGET_BOARD_CAMERA_UV_DENOISE := false
#supprt ai sence
TARGET_BOARD_CAMERA_AI := false
#select continuous auto focus
TARGET_BOARD_CAMERA_CAF := false
#select camera support autofocus
TARGET_BOARD_CAMERA_AUTOFOCUS := true
#support auto anti-flicker
TARGET_BOARD_CAMERA_ANTI_FLICKER := false
#GYRO
TARGET_BOARD_CAMERA_GYRO := true
#PIP/VIV
TARGET_BOARD_CAMERA_PIPVIV_SUPPORT := false
#------section 4: optimize config------
#rotation capture
TARGET_BOARD_CAMERA_ROTATION_CAPTURE := false
TARGET_BOARD_FRONT_CAMERA_ROTATION := false
#image angle in different project
TARGET_BOARD_CAMERA_ADAPTER_IMAGE := 180
#pre_allocate capture memory
TARGET_BOARD_CAMERA_PRE_ALLOC_CAPTURE_MEM := false
#low capture memory
TARGET_BOARD_LOW_CAPTURE_MEM := true
#Slowmotion optimize
TARGET_BOARD_SPRD_SLOWMOTION_OPTIMIZE := false
#------section 5: other misc config------
#sensor multi-instance
TARGET_BOARD_CAMERA_SENSOR_MULTI_INSTANCE_SUPPORT := false
#memory detect tool asan
TARGET_BOARD_CAMERA_ASAN_MEM_DETECT := false
# ===============end of camera configuration ===============

# set camera recording frame rate dynamic
TARGET_BOARD_CONFIG_CAMRECORDER_DYNAMIC_FPS :=false

TARGET_BOARD_CAMERA_FUNCTION_DUMMY := false
TARGET_BOARD_CAMERA_MODULAR := true

$(call inherit-product-if-exists, vendor/sprd/modules/libcamera/libcam_device.mk)

#enable blur camera feature
PRODUCT_PROPERTY_OVERRIDES += \
    persist.vendor.cam.fr.blur.version = 1    \
    persist.vendor.cam.ba.blur.version = 1 \
    persist.vendor.cam.blur.cov.id = 3        \
    persist.vendor.cam.res.blur.fr = RES_2M   \
    persist.vendor.cam.res.blur.ba = RES_5M
#MMI main menu camera calibration & verification entry: 0-not display, 1-display
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.multicam.cali.veri=0
#enable back portrait mode
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.ba.portrait.enable=0
#enable front portrait mode
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.fr.portrait.enable=0
#enable nightshot pro
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.night.pro.enable=1
#enable video face detect
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.video.fd.enable=0
#enable 3dnr
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.3dnr.version=1
#face_beauty lib   0--close_fb  1--arcsoft  2--sprd
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.facebeauty.corp=2
#disable refocus
#PRODUCT_PROPERTY_OVERRIDES += persist.sys.cam.refocus.enable=false
#Camera filter
PRODUCT_PROPERTY_OVERRIDES += persist.sys.cam.filter.version=2
#enable cnr
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.cnr.mode=1
#enable camera selfshot/turnpage feature
#PRODUCT_PROPERTY_OVERRIDES += persist.sys.cam.covered.enable=false

#enable faceID
TARGET_BOARD_FACE_UNLOCK_SUPPORT := true
#faceid version    0--disable  1--single_camera  2--dual_camera
PRODUCT_PROPERTY_OVERRIDES += persist.vendor.cam.faceid.version=1

$(call inherit-product-if-exists, vendor/sprd/modules/faceunlock/faceunlock_device.mk)
